doctype html
html
  head
    meta(charset='UTF-8')
    title Swagger UI
    link(rel='icon', type='image/png', href='vendor/swagger/images/favicon-32x32.png', sizes='32x32')
    link(rel='icon', type='image/png', href='vendor/swagger/images/favicon-16x16.png', sizes='16x16')
    link(href='vendor/swagger/css/typography.css', media='screen', rel='stylesheet', type='text/css')
    link(href='vendor/swagger/css/reset.css', media='screen', rel='stylesheet', type='text/css')
    link(href='vendor/swagger/css/screen.css', media='screen', rel='stylesheet', type='text/css')
    link(href='vendor/swagger/css/reset.css', media='print', rel='stylesheet', type='text/css')
    link(href='vendor/swagger/css/print.css', media='print', rel='stylesheet', type='text/css')
    script(src='vendor/swagger/lib/object-assign-pollyfill.js', type='text/javascript')
    script(src='vendor/swagger/lib/jquery-1.8.0.min.js', type='text/javascript')
    script(src='vendor/swagger/lib/jquery.slideto.min.js', type='text/javascript')
    script(src='vendor/swagger/lib/jquery.wiggle.min.js', type='text/javascript')
    script(src='vendor/swagger/lib/jquery.ba-bbq.min.js', type='text/javascript')
    script(src='vendor/swagger/lib/handlebars-4.0.5.js', type='text/javascript')
    script(src='vendor/swagger/lib/lodash.min.js', type='text/javascript')
    script(src='vendor/swagger/lib/backbone-min.js', type='text/javascript')
    script(src='vendor/swagger/swagger-ui.js', type='text/javascript')
    script(src='vendor/swagger/lib/highlight.9.1.0.pack.js', type='text/javascript')
    script(src='vendor/swagger/lib/highlight.9.1.0.pack_extended.js', type='text/javascript')
    script(src='vendor/swagger/lib/jsoneditor.min.js', type='text/javascript')
    script(src='vendor/swagger/lib/marked.js', type='text/javascript')
    script(src='vendor/swagger/lib/swagger-oauth.js', type='text/javascript')
    // Some basic translations
    <script src='vendor/swagger/lang/translator.js' type='text/javascript'></script>
    <script src='vendor/swagger/lang/es.js' type='text/javascript'></script>
    // <script src='swagger/lang/en.js' type='text/javascript'></script>
    script(type='text/javascript').
      $(function () {
        var url = window.location.search.match(/url=([^&]+)/);
        if (url && url.length > 1) {
          url = decodeURIComponent(url[1]);
        } else {
          url = "/vendor/swagger/api.json";
        }
        hljs.configure({
          highlightSizeThreshold: 5000
        });
        // Pre load translate...
        if(window.SwaggerTranslator) {
          window.SwaggerTranslator.translate();
        }
        window.swaggerUi = new SwaggerUi({
          url: url,
          dom_id: "swagger-ui-container",
          supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
          onComplete: function(swaggerApi, swaggerUi){
            var a = document.createElement("p");
            var apikey = "#{apikey}" ;
            a.innerHTML = "Tu api key es: "+apikey
            document.getElementsByClassName("info_description")[0].appendChild(a)
            var apis = document.getElementsByName("apikey");
            /*apis.map(function(api){
              api.value = apikey;
              return api;
            });*/
            if(window.SwaggerTranslator) {
              window.SwaggerTranslator.translate();
            }
          },
          onFailure: function(data) {
            log("Unable to Load SwaggerUI");
          },
          docExpansion: "none",
          jsonEditor: true,
          defaultModelRendering: 'schema',
          showRequestHeaders: false
        });
        window.swaggerUi.load();
        function log() {
          if ('console' in window) {
            console.log.apply(console, arguments);
          }
        }
      });
  body.swagger-section
    #header
      .swagger-ui-wrap
        a#logo(href='/user')
          img.logo__img(alt='swagger', height='30', width='30', src='vendor/swagger/images/logo_small.png')
          span.logo__title Swagger-Uchuva
        form#api_selector
          .input
            input#input_baseUrl(placeholder='http://uchuva.com/api', name='baseUrl', type='text')
          #auth_container
          .input
            a#explore.header__btn(href='#', data-sw-translate='') Explore
    #message-bar.swagger-ui-wrap(data-sw-translate='')  
    #swagger-ui-container.swagger-ui-wrap
